﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace benefit.Controllers
{
    public class CompanyController : System.Web.Mvc.Controller
    {
        //
        // GET: /Company/

        public ActionResult Index(int uid, string pdate)
        {
            Benefit.Interface.Sys.IVisitPrower IVisitPrower = new Benefit.Service.Sys.ServiceVisitPrower(db);
            int operId = 1;
            if (IVisitPrower.HasCompanyPrower(operId))
            {
                Benefit.ViewModel.Day.Company model = new Benefit.ViewModel.Day.Company(uid, Convert.ToInt32(pdate), db);
                db.Dispose();
                return View(model);
            }
            else
            {
                db.Dispose();
                return Redirect("/Error/HasNoPrower/" + uid + "/" + pdate);
            }
        }

    }
}
